﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Resources/Master.Master" AutoEventWireup="true" CodeBehind="CheckOut.aspx.cs" Inherits="Assignment_3.Feature___Booking.CheckIn" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function PrintPanel() {
            var panel = document.getElementById("<%=printPnl.ClientID %>");
            var printWindow = window.open('', '', 'height=400,width=800');
            printWindow.document.write('<html><head><title>DIV Contents</title>');
            printWindow.document.write('</head><body >');
            printWindow.document.write(panel.innerHTML);
            printWindow.document.write('</body></html>');
            printWindow.document.close();
            setTimeout(function () {
                printWindow.print();
            }, 500);
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="margin-top: 20px; margin-left: 3%; margin-right: 3%">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:Panel ID="printPnl" runat="server">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <h1>Check Out</h1>
                    Search for Invoice by booking ID:
                    <asp:TextBox ID="searchTbx" runat="server" MaxLength="9"></asp:TextBox>
                    <ajaxToolkit:FilteredTextBoxExtender ID="searchTbx_FilteredTextBoxExtender" runat="server" FilterType="Numbers" TargetControlID="searchTbx">
                    </ajaxToolkit:FilteredTextBoxExtender>

                    <asp:Button ID="searchBtn" runat="server" OnClick="searchBtn_Click" Text="Search" />

                    <asp:RequiredFieldValidator ID="bookingVld" runat="server" ControlToValidate="searchTbx" Display="Dynamic" ErrorMessage="Please enter a Booking ID" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:Label ID="bookingLbl" runat="server" ForeColor="Red"></asp:Label>
                    <br />
                    <asp:Panel ID="infoPnl" runat="server" Visible="False">

                        <br />
                        <table class="auto-style1" style="text-align: left">
                            <tr>
                                <td class="spacer">Booking ID:</td>
                                <td class="spacer">
                                    <asp:Label ID="bookingIDLbl" runat="server"></asp:Label>
                                </td>
                                <td class="spacer">Check-in Date:</td>
                                <td class="spacer">
                                    <asp:Label ID="checkinLbl" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Guest ID:</td>
                                <td>
                                    <asp:Label ID="guestIDLbl" runat="server"></asp:Label>
                                </td>
                                <td>Check-out Date:</td>
                                <td>
                                    <asp:Label ID="checkoutLbl" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="spacer">Guest Name:</td>
                                <td class="spacer">
                                    <asp:Label ID="guestnameLbl" runat="server"></asp:Label>
                                </td>
                                <td class="spacer">No. of Rooms:</td>
                                <td class="spacer">
                                    <asp:Label ID="noofroomsLbl" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="spacer">Phone Number:</td>
                                <td class="spacer">
                                    <asp:Label ID="phonenoLbl" runat="server"></asp:Label>
                                </td>
                                <td class="spacer">Room Type:</td>
                                <td class="spacer">
                                    <asp:Label ID="roomtypeLbl" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Email:</td>
                                <td>
                                    <asp:Label ID="emailLbl" runat="server"></asp:Label>
                                </td>
                                <td>Bed Type:</td>
                                <td>
                                    <asp:Label ID="bedtypeLbl" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Address:</td>
                                <td>
                                    <asp:Label ID="addressLbl" runat="server"></asp:Label>
                                </td>
                                <td>Payment Type:</td>
                                <td>
                                    <asp:Label ID="paymenttypeLbl" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Postal Code:</td>
                                <td>
                                    <asp:Label ID="postalcodeLbl" runat="server"></asp:Label>
                                </td>
                                <td>Expiration Date:</td>
                                <td>
                                    <asp:Label ID="expirationLbl" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td>Country:</td>
                                <td>
                                    <asp:Label ID="countryLbl" runat="server"></asp:Label>
                                </td>
                                <td>Credit Card No.:</td>
                                <td>
                                    <asp:Label ID="creditcardnoLbl" runat="server"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td>No. of Adults</td>
                                <td>
                                    <asp:Label ID="noofadultsLbl" runat="server"></asp:Label>
                                </td>
                                <td class="auto-style2">Room Rates(per room):</td>
                                <td>
                                    <asp:Label ID="roomratesLbl" runat="server" ForeColor="Red"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td class="spacer">No. of Children</td>
                                <td class="spacer">
                                    <asp:Label ID="noofchildrenLbl" runat="server"></asp:Label>
                                </td>
                                <td class="auto-style3">Price of Items Consumed:</td>
                                <td class="spacer">
                                    <asp:Panel ID="labelPnl" runat="server">
                                        <asp:Label ID="itemsconsumedLbl" runat="server" ForeColor="Red"></asp:Label>
                                    </asp:Panel>
                                    <asp:Panel ID="textPnl" runat="server">
                                        <asp:TextBox ID="itemsconsumedTbx" runat="server" MaxLength="5"></asp:TextBox>
                                        <ajaxToolkit:FilteredTextBoxExtender ID="itemsconsumedTbx_FilteredTextBoxExtender" runat="server" FilterType="Numbers" TargetControlID="itemsconsumedTbx">
                                        </ajaxToolkit:FilteredTextBoxExtender>
                                    </asp:Panel>
                                    <asp:Button ID="editBtn" runat="server" OnClick="editBtn_Click" Text="Edit" />
                                </td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td class="auto-style2">Total Price:</td>
                                <td>
                                    <asp:Label ID="totalLbl" runat="server" ForeColor="Red"></asp:Label>
                                </td>
                            </tr>
                        </table>
                        <br />
                        <asp:Button ID="statusBtn" runat="server" OnClick="statusBtn_Click" Text="Change Room Status" OnClientClick="return confirm('Confirm change to room status?');" />
                        &nbsp;<asp:Button ID="printBtn" runat="server" OnClientClick="return PrintPanel();" Text="Print Preview" />
                    </asp:Panel>
                </ContentTemplate>
            </asp:UpdatePanel>
            <br />
        </asp:Panel>
    </div>
</asp:Content>
